package cn.s1995.sloth.bizs.service.impl;

import cn.s1995.sloth.bizs.constant.CacheNames;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.s1995.sloth.bizs.entity.MessageTemplate;
import cn.s1995.sloth.bizs.mapper.MessageTemplateMapper;
import cn.s1995.sloth.bizs.service.MessageTemplateService;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.io.Serializable;

/**
 * 消息模板
 *
 * @author Lex
 * @date 2024-01-10 08:11:26
 */
@Service
public class MessageTemplateServiceImpl extends ServiceImpl<MessageTemplateMapper, MessageTemplate> implements MessageTemplateService {

    @Override
    @Cacheable(value = CacheNames.messageTemplate, key = "#id")
    public MessageTemplate getMessageTemplate(Serializable id) {
        return this.getById(id);
    }

    @Override
    @CacheEvict(value = CacheNames.messageTemplate, key = "#id")
    public void removeCacheMessageTemplate(Serializable id) {

    }
}
